package com.heitian.ssm.controller;

import com.heitian.ssm.dao.DemoVideoDao;
import com.heitian.ssm.dao.VideoDao;
import com.heitian.ssm.model.*;
import com.heitian.ssm.service.UserService;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * Created by Zhangxq on 2016/7/15.
 */

@Controller
@RequestMapping("/video")
public class VideoController {

    private Logger log = Logger.getLogger(UserController.class);
    @Resource
    private VideoDao videoDao;
    @Resource
    private DemoVideoDao demoVideoDao;

    @RequestMapping(method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    public JsonResponsee selectVideo() {

        List<Video> videoList = videoDao.selectVideo();
        return new JsonResponsee(videoList);
    }

}
